package com.zycoin.demo.mybatis;

import com.zycoin.common.plugin.mybatis.page.Page;
import com.zycoin.demo.mybatis.domain.City;
import com.zycoin.demo.mybatis.mapper.CityMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.List;

/**
 * Created by lenovo on 2017/5/19.
 */
@SpringBootApplication
public class MybatisApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(MybatisApplication.class);
        CityMapper cityMapper =run.getBean(CityMapper.class);
        Page page = new Page();
        page.setPageSize(1);
        page.setStartNum(0);
        City city = new City();
//        city.setId(1);
        city.setPageMap(page);
        List<City> cityList =cityMapper.select(city);
        System.out.println(cityList.get(0).toString());
    }
}
